var Template = function(){
    return Template.fn.init();
}


Template.fn = Template.prototype = {

	// Init
	init:function(){},

   /**
	* Compile
	* @param:
	*/
	render: function (jshtml, json)
	{
		var jstemplate = Handlebars.compile(jshtml);
		return jstemplate( json );
	},

	/**
	* Load tempate
	* @param:
	*/
	load: function (tmpName, tmpPath)
	{
		var def = $.Deferred();
		var url = '/Tpmls/loadJsTpml/' + tmpName + '/' + tmpPath;

		$.when( loader.getAjax(url, false, 'html') ).then(function(jshtml){
			def.resolve(jshtml);
		});

		return def;
	}


};

var template = new Template();